package com.admin.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.admin.bean.AdminUserBean;
import com.admin.bean.VisitLogBean;
import com.admin.service.AdminUserService;
import com.admin.service.VisitLogService;
import com.admin.util.BaseUtil;
import com.admin.util.PageBean;

/**   
 * @Title: VisitLogAction.java
 * @Package com.admin.action
 * @Description: 
 * @author Jason
 * @date 2010-12-16 ����11:27:29    
 * @version    
 */

@Controller
@RequestMapping("/calllog")
public class VisitLogAction {
	
	@Autowired private VisitLogService visitLogService;
	@Autowired private AdminUserService adminUserService;
	
	@RequestMapping()
	public String list(HttpServletRequest request){
//		int userId = BaseUtil.stringToInt(request.getParameter("userId"));
//		AdminUserBean adminUsr = (AdminUserBean) request.getSession().getAttribute("adminUser");
//		if(adminUsr.getUserName().equals("admin")){
//			List<AdminUserBean> adminUserList = adminUserService.findAll(0, adminUserService.findCount());
//			request.setAttribute("adminUserList", adminUserList);
//		}else{
//			if(userId==0)userId = adminUsr.getUserId();
//		}
//		String startTime = request.getParameter("startTime");
//		String endTime = request.getParameter("endTime");
//		int totalCount = visitLogService.findCount(userId, startTime, endTime);
//		int currentPage = BaseUtil.stringToInt(request.getParameter("currentPage"), 1);
//		PageBean<VisitLogBean> page = new PageBean<VisitLogBean>(totalCount, currentPage);
//		List<VisitLogBean> logList = visitLogService.findByCondition(userId, startTime, endTime, page.getStart(), page.getPageSize());
//		page.setResult(logList);
//		page.setUrl("?userId="+userId+"&startTime="+(startTime==null?"":startTime)+"&endTime="+(endTime==null?"":endTime));
//		request.setAttribute("pageBean", page);
//		request.setAttribute("userId", userId);
//		request.setAttribute("startTime", startTime);
//		request.setAttribute("endTime", endTime);
		return "logList";
	}
}
